import Vue from 'vue'
import App from './App.vue'

//引入路由
import router from '@/router'

//引入仓库
import store from '@/store';

//三级联动组件---全局组件
import TypeNav from '@/components/TypeNav';
//轮廓图组件---全局组件
import Carousel from '@/components/Carousel';
//分页器组件---全局组件
import Pagination from '@/components/Pagination';
//引入element-Ui组件
import { Button, MessageBox } from 'element-ui';
Vue.component(TypeNav.name, TypeNav)
Vue.component(Carousel.name, Carousel)
Vue.component(Pagination.name, Pagination)
Vue.component(Button.name, Button)
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
//引入mock
import '@/mock/mockServe';
//引入swiper
import 'swiper/css/swiper.css';
//统一接受api接口
import * as API from '@/api';
//引入懒加载图片
import lazyImg from '@/assets/1.gif';
//引入拉加载插件
import VueLazyload from 'vue-lazyload';
//注册插件
Vue.use(VueLazyload, {
  //懒加载默认图片
  loading: lazyImg,
})

//引入自定义插件,举例用的不用
// import myPlugins from '@/plugins/myPlugins';
// Vue.use(myPlugins, {
//   name: 'zs'
// })

//引入表单验证插件
import '@/plugins/validate';

Vue.config.productionTip = false
new Vue({
  render: h => h(App),
  //配置全局总线，$bus
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API
  },
  router,
  store
}).$mount('#app')
